import React from 'react';
import {SecurityUser} from "type/entity/SecurityUser";
import {fetchUpdateUser} from "storage/redux/async-action/userAsyncAction";
import FormEnhance, {InputNumber, InputRadio, InputSwitch, InputText} from "common/form";

const UserUpdateComponent = () => {
    return (
        <FormEnhance
            title={"更新用户信息"}
            backupText={"用户列表"}
            requestAction={fetchUpdateUser}
        >
            <InputText<SecurityUser> name={"username"} label={"用户名"} required={true}/>
            <InputText<SecurityUser> name={"identity"} label={"用户身份"} required={true}/>
            <InputRadio<SecurityUser> name={"gender"} label={"用户性别"}/>
            <InputNumber<SecurityUser> name={"age"} label={"用户年龄"}/>
            <InputSwitch<SecurityUser> name={"enabled"} label={"用户可用"}/>
            <InputSwitch<SecurityUser> name={"accountNonLocked"} label={"用户未锁定"}/>
        </FormEnhance>
    );
};

export default UserUpdateComponent;